package com.jgame.secondarymarket.domain.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Set;

/**
 * @title: Product
 * @Author Wangsj
 * @Date: 2021/7/21
 */
@Data
@TableName(value = "product")
public class Product extends ProductBase {

    @NotNull(message = "商品名称不能为空")
    @TableField(value = "name")
    private String name;

    @Max(value = 10, message = "评分最大值为10")
    @Min(value = 0, message = "评分最小值为0")
    @TableField(value = "rate")
    private Double rate;

    @NotNull(message = "商品一级分类称不能为空")
    @TableField("category_fist")
    private String categoryFist;

    @NotNull(message = "商品二级分类称不能为空")
    @TableField("category_second")
    private String categorySecond;

    @TableField(exist = false)
    private Set<Specification> specifications;

    @TableField(exist = false)
    private Set<ProductProperties> properties;


}
